package com.zxl.yunpicture.domain.user.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zxl.yunpicture.domain.user.entity.User;
import com.zxl.yunpicture.interfaces.dto.user.UserLoginRequest;
import com.zxl.yunpicture.interfaces.dto.user.UserQueryRequest;
import com.zxl.yunpicture.interfaces.dto.user.UserRegisterRequest;
import com.zxl.yunpicture.interfaces.vo.user.LoginUserVO;
import com.zxl.yunpicture.interfaces.vo.user.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Set;

/**
* @author 16328
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-01-27 16:19:41
*/
public interface UserDomainService {


    /**
     * 用户注册
     * @param userRegisterRequest
     * @return
     */
    long userRegister(UserRegisterRequest userRegisterRequest);


    /**
     * 获取加密后的密码
     * @param userPassword
     * @return
     */
    String getEncryptPassword(String userPassword);

    /**
     * 用户登录
     * @param userLoginRequest
     * @return
     */
    LoginUserVO userLogin(UserLoginRequest userLoginRequest, HttpServletRequest request);


    /**
     * 得到用户登录信息
     * @param request
     * @return
     */
    User getLoginUser(HttpServletRequest request);


    /**
     * 获取脱敏的已登录用户信息
     *
     * @return
     */
    LoginUserVO getLoginUserVO(User user);


    /**
     * 获取脱敏的用户信息
     *
     * @return
     */
    UserVO getUserVO(User user);


    /**
     * 获取脱敏的用户信息列表
     *
     * @return
     */
    List<UserVO> getUserVOList(List<User> userList);


    /**
     * 用户注销
     * @param request
     * @return
     */
    boolean userLogout(HttpServletRequest request);


    /**
     * 获取查询条件
     * @param userQueryRequest
     * @return
     */
    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);


    Boolean removeById(Long id);

    boolean updateById(User user);

    User getById(long id);

    Page<User> page(Page<User> userPage, QueryWrapper<User> queryWrapper);

    List<User> listByIds(Set<Long> userIdSet);

    boolean saveUser(User userEntity);

    Page<UserVO> listUserVOByPage(UserQueryRequest userQueryRequest);
}
